<!DOCTYPE html>
<html lang="km">
    <head>
        <meta charset="utf-8" />
        <title><?php echo $title; ?></title>
        <meta name="keywords" content="web store, free templates, website templates, CSS, HTML" />
        <meta name="description" content="Web Store Theme - free CSS template provided by templatemo.com" />


        <!-- start msg error register -->

        <style type="text/css">
            
        </style>
        <script type="text/javascript" src="<?php echo site_url(); ?>/frontend/js/jquery.min.js"></script>
        

        <link href="<?php echo site_url(); ?>frontend/css/templatemo_style.css" rel="stylesheet" type="text/css" />


        <link rel="stylesheet" type="text/css" href="<?php echo site_url(); ?>frontend/css/styles.css" />
        <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>frontend/scripts/mootools-1.2.1-core.js"></script>
        <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>frontend/scripts/mootools-1.2-more.js"></script>
        <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>frontend/scripts/slideitmoo-1.1.js"></script>

<!--<script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/frontend/js/fallingstar.js"></script>-->
        <!--star-->

        <script language="javascript" type="text/javascript">
            window.addEvents({
                'domready': function(){
                    /* thumbnails example , div containers */
                    new SlideItMoo({
                        overallContainer: 'SlideItMoo_outer',
                        elementScrolled: 'SlideItMoo_inner',
                        thumbsContainer: 'SlideItMoo_items',		
                        itemsVisible: 5,
                        elemsSlide: 3,
                        duration: 2000,
                        itemsSelector: '.SlideItMoo_element',
                        itemWidth: 171,
                        showControls:1});
                },
		
            });

            function clearText(field)
            {
                if (field.defaultValue == field.value) field.value = '';
                else if (field.value == '') field.value = field.defaultValue;
            }
        </script>


        <!-- menu -->

        <link type="text/css" href="<?php echo site_url(); ?>frontend/js/menus/menu.css" rel="stylesheet" />

        <script type="text/javascript" src="<?php echo site_url(); ?>frontend/js/menus/menu.js"></script>


    </head>

    <body id="home">
		<?php //echo $this->session->userdata('id'); 
		//die();
		?>
        <div id="templatemo_wrapper">
            <div id="templatemo_header">
                <div id="site_title">
                    <a href="#">
                        <img src="<?php echo site_url(); ?>frontend/images/logo.jpg" />
                    </a>

                </div>
                <div id="site_center" style="width:600px; float: left; margin-top: 11px;">
                 
                 <?php 
						if($adver_img->num_rows() > 0){
							foreach($adver_img->result() as $rows){
								if($rows->pos_name == "top"){
								$adverImg = array(
									'src' => 'advertising/uploads/' . $rows->media_img,
									'alt' => $rows->media_name,
									'width' => '610px',
									'height' => '80px',
									'title' => $rows->media_name,
									'rel' => 'lightbox',
									'style' => 'margin-left:2px; margin-top:-5px;'
								);

						?>
                        <a href="<?php echo $rows->media_url; ?>">
                        <?php echo img($adverImg); ?>
                       </a></li>
                       <?php 
								}
							}
						}
					   ?>
                </div>
                <div id="header_right">
                    <ul id="language">
                        <li><?php echo date('d-M-Y'); ?></li>
                        <li>Welcome <a href="<?php echo site_url('pages/user_profile'); ?>"><?php echo $this->session->userdata('name'); ?></a> |</li>
                        <li>
                       
                      </li>
                      

                    </ul>
                    <div class="cleaner"></div>
                    <div id="templatemo_search">
                   		<!--<form action="#" method="get">
                            <input type="text" value="Search in pages..." name="keyword" id="keyword" title="keyword" onFocus="clearText(this)" onBlur="clearText(this)" class="txt_field" />
                            <input type="submit" name="Search" value="" alt="Search" id="searchbutton" title="Search" class="sub_btn"  />
                        </form>-->
                         <?php                               
                                echo form_open(site_url('pages/search'));
                                    $proname = array(
                                        'name' => 'search_box',
                                        'placeholder' => 'Product name...',
										'type' => 'text',
										'id' => 'keyword',
										'onFocus' => 'clearText(this)',
										'onBlur' => 'clearText(this)',
										'class' => 'txt_field'
                                    );
                                    $submit = array(
                                        'name' => 'save',
                                        'type' => 'submit',
										'alt' => 'Search products',
										'id' => 'searchbutton',
										'class' => 'sub_btn',
										'title' => 'Search products',
                                        'value' => ''
                                    );

                                    ?>
                                    <?php echo form_input($proname); ?>
                                   
                                    <?php echo form_submit($submit); ?>
                                    <?php echo form_close(); ?>
                    </div>
                </div> <!-- END -->
            </div> <!-- END of header -->

            <div id="templatemo_menu" class="ddsmoothmenu">
                <a href="http://apycom.com/"></a>
                <?php echo $this->load->view('menu'); ?>


                <br style="clear: left" />
            </div> <!-- end of templatemo_menu -->


            <div id="templatemo_main_top">

            </div>
            <div id="templatemo_main">
                <div id="product_slider">
                    <div id="SlideItMoo_outer">	
                        <div id="SlideItMoo_inner">			
                            <div id="SlideItMoo_items">
                                <?php 
								if($sli_pro->num_rows()>0){
									foreach($sli_pro->result() as $rows){
								?>
                                    <div class="SlideItMoo_element">
                                        <a href="<?php echo site_url("pages/news_detail"); ?>/<?php echo $rows->page_id; ?>">
                                            <img width="135px" height="133px" src="<?php echo site_url().'news/uploads/' . $rows->page_img; ?>" title="<?php echo $rows->page_title; ?>" />
                                            </a>
                                    </div>	
                                    <?php
									}
                                }
                                ?>
                            </div>			
                        </div>
                    </div>
                    <div class="cleaner"></div>
                </div>

                <div id="sidebar">
                    <?php if ($this->uri->segment(2) == 'products') { ?>
                        <h3>Categories</h3>
                        <ul class="sidebar_menu">
                            <li>&nbsp;Phones Models &darr;</li>
                            <li><a href="#"> Apple </a></li>
                            <li><a href="#"> Samsung</a></li>				
                            <li><a href="#"> Nokia</a></li>
                            <li><a href="#"> Sony</a></li>	
                            <li>&nbsp;Computers Models &darr;</li>
                            <li><a href="#"> Dell </a></li>
                            <li><a href="#"> Accer</a></li>				
                            <li><a href="#"> HP</a></li>
                            <li><a href="#"> Assus</a></li>				

                        </ul>

                        <?php
                    } else if ($this->uri->segment(2) != 'signup_account' && $this->session->userdata('id') == "") {
                        ?>
                        <h3>Advertiser Login</h3>
                        <?php
                        if ($this->uri->segment(3) == 'error') {
                            echo "<span style='color:red'>Incorrect username or password !</span><br />";
                        }
                        ?>
                        <br>


                        <form action="<?php echo site_url('pages/index'); ?>" method="post">
                        	Username :<input type="text" name="username" placeholder="Username..." required="" autofocus /><p style="margin-top:10px;">
                                Password &nbsp;:<input type="password" name="pass" placeholder="Password..." required="" /><p>
                            <input type="submit" name="login" value="Sign in" /><p>
                                &raquo; <a href="<?php echo site_url('pages/signup_account'); ?>">Sign Up !</a>
                                &raquo; <a href="forgetacount?">Forget your account !</a>
                        </form>
                    <?php } else if ($this->session->userdata('id') > 0) {
								if($this->session->userdata('statu') == 1){
                        ?>
                        <h3><?php echo $this->session->userdata('name'); ?> || <a href="<?php echo site_url('pages/logout'); ?>">Logout</a></h3>
                        <ul style="display: inline;
                            list-style:none;">
                            
                            <li><a href="<?php echo site_url("pages/user_profile/"); ?>">User Profile</a></li>
                            <li><a href="<?php echo site_url("pages/user_update_account/".$this->session->userdata('id')); ?>">Update account</a></li>
                            <li><a href="<?php echo site_url("pages/user_change_pass/".$this->session->userdata('id')); ?>">Change Password</a></li>
                            <li><a href="<?php echo site_url("pages/user_add_products"); ?>" >Add your products</a></li>
                            <li><a href="<?php echo site_url("pages/user_view_product"); ?>">View your products</a></li>
                            <li><a href="up_account?">Share to your friends</a></li>
                            <li><a href="up_account?">Find friends</a></li>
                        </ul>
                        <hr class="news_hr" />	
                        <?php
								}
						
                    }
                    ?>


                    <h3>Latest Advertise</h3>
					<?php 
						if($adver_img->num_rows() > 0){
							foreach($adver_img->result() as $rows){
								if($rows->pos_name == "side_left"){
								$adverImg = array(
									'src' => 'advertising/uploads/' . $rows->media_img,
									'alt' => $rows->media_name,
									'class' => 'ad_img',
									'title' => $rows->media_name,
									'rel' => 'lightbox',
									'style' => 'margin-left:2px; margin-top:-5px;'
								);

						?>
                        <a href="<?php echo $rows->media_url; ?>">
                        <?php echo img($adverImg); ?>
                       </a></li>
                       <?php 
								}
							}
						}
					   ?>
                       
                    <!--<hr class="news_hr" />
                    <h3>Listen new songs</h3>
                    <object width="238" height="330" data="http://www.lookingtoday.com/modules/mod_simple_mp3_player/simple_mp3_player.swf" type="application/x-shockwave-flash">
                        <param value="#7EAE15" name="bgcolor">
                        <param value="window" name="wmode">
                        <param value="playlist=http://www.lookingtoday.com/mp3/playlist24012013.txt&width=238&height=330&showinfo=1&showvolume=1&volume=75&volumewidth=40&volumeheight=15&autoplay=0&loop=0&shuffle=0&showloading=always&loadingcolor=FFFFFF&showlist=1&showplaylistnumbers=1&playlistcolor=6b6c03&playlistalpha=200&showslider=1&sliderwidth=20&sliderheight=8&slidercolor1=FFFFFF&slidercolor2=FFFFFF&sliderovercolor=000000&bgcolor=F5F5F5&bgcolor1=7EAE15&bgcolor2=7EAE15&textcolor=000000&currentmp3color=FFFFFF&buttonwidth=20&buttoncolor=FFFFFF&buttonovercolor=000000&scrollbarcolor=FFFFFF&scrollbarovercolor=000000" name="FlashVars">
                    </object>-->
                    <hr class="news_hr" />
                    <h3>Hot! Hot! News</h3>
                    <div style="border:1px solid #ccc;">
                    
                    <iframe src="http://www.posteveryday.com/feature" scrolling="no" frameborder="0" height='120px' width='290px'></iframe>
                    </div>

                    <h5>Find Us on Facebook</h5>
                    <div id="fb-root"></div>
						<script>(function(d, s, id) {
                        var js, fjs = d.getElementsByTagName(s)[0];
                        if (d.getElementById(id)) return;
                        js = d.createElement(s); js.id = id;
                        js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
                        fjs.parentNode.insertBefore(js, fjs);
                        }(document, 'script', 'facebook-jssdk'));</script>
                                        <div class="fb-like-box" data-href="http://www.facebook.com/OyagaGroupWep" data-width="238" data-height="220" data-show-faces="true" data-stream="false" data-header="false"></div>

					<p>Describe about your favourite and want from my website. THANK YOU !</p>
                    <div id="newsletter">
                        <form action="#" method="get">
                            <input type="text" value="Subscribe" name="email_newsletter" id="email_newsletter" title="email_newsletter" onFocus="clearText(this)" onBlur="clearText(this)" class="txt_field" />
                            <input type="submit" name="subscribe" value="Subscribe" alt="Subscribe" id="subscribebtn" title="Subscribe" class="subscribebtn"  />
                        </form>
                        <div class="cleaner"></div>
                    </div>


                </div> <!-- END of sidebar -->

                <div id="content">

                    <?php
                    $seg1 = $this->uri->segment(1); // controller = directory
                    $seg2 = $this->uri->segment(2); // method = file
                    if (!$seg2) {
                        $this->load->view("pages/news");
                    } else {
                        $this->load->view($seg1 . "/" . $seg2);
                        //$this->load->view("users/register");
                    }
                    ?>



                </div> <!-- END of content -->

                <h5>What do want us to updat for you ?</h5>
                <div id="fb-root"></div>
                <script>(function(d, s, id) {
                    var js, fjs = d.getElementsByTagName(s)[0];
                    if (d.getElementById(id)) return;
                    js = d.createElement(s); js.id = id;
                    js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
                    fjs.parentNode.insertBefore(js, fjs);
                }(document, 'script', 'facebook-jssdk'));</script>

                <div class="fb-comments" data-href="http://mlup-baitong.comoj.com/" data-width="662" data-num-posts="10"></div>

                <div class="cleaner"></div>
            </div> <!-- END of main -->

            <div id="templatemo_footer">
                
     </div>
 <!--    <script type="text/javascript" src="http://static.addtoany.com/menu/page.js"></script>
 Lockerz Share END -->
                <!--end social-->
                

                <div class="cleaner h40"></div>
                <center>
			Copyright © 2013 Need Jobs | Designed by <a href="#" target="_parent">Group Developers</a>
                </center>
                
                
                
            </div> <!-- END of footer -->   

        </div>

    </body>
</html>